/**
 * 
 */

/**
 * @author Angel Ortiz
 *
 */
public class Caeser extends Cipher

{

public Caeser(String s)

{

}

public String encode(String word)

{

}

public String decode(String word)

{

 // Complete this method so that it decodes the encoded string

 }

String code(String word, int SHIFT)

{

super(s);

return code(word,Constants.ENCODE_SHIFT );

StringBuffer result = new StringBuffer();

for (int i = 0; i < word.length(); i++)

{

char ch = word.charAt(i);

ch = determineCharacter(ch, SHIFT);

result.append(ch);

}

return result.toString();

}

public char determineCharacter(char ch, final int shift)

{

if(Character.isUpperCase(ch))

ch = (char)('A' + (ch - 'A' + shift) % Constants.WRAP_AROUND);

// Complete the if/else so that lower case letters are accounted for

return ch;

}

}